package com.practice.springboot_01_zwj.scheduled;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

@Service
public class FileImportService {
    @Autowired
    private IncomeQuestionImportService incomeQuestionService;

    @Autowired
    private ThreeHundredImportService threeHundredService;

    @Autowired
    private EightRateImporterService healthyEightRateService;

    @Value("${file.path}")
    private String filePath;

    /**
     * 执行文件导入任务
     */
    public void executeFileImport() {
        System.out.println("执行文件导入任务: " + System.currentTimeMillis() + filePath);

        String fileName1 = filePath + "ProjectRevenueContorlInfo.txt";
        incomeQuestionService.importLargeFile(fileName1);

        String fileName2 = filePath + "projectBidAmountOver300Info.txt";
        threeHundredService.importLargeFile(fileName2);

        String fileName3 = filePath + "HealthTenRateInfo.txt";
        healthyEightRateService.importLargeFile(fileName3);
    }
}
